{{define "user/resetpwd.html"}}
<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
  <head>
		{{template "public/head.html"}}
<style>
    .bg {
    width: 100%;
    height: 100%;
    background: url("{{asset}}/images/bg.jpg") no-repeat center center;
    background-size: cover;
    margin: 0;
    padding: 0;
	}
</style>
  </head>
 <body class="hold-transition login-page bg">
    <div class="login-box">
      <div class="login-logo">
        <a ><b>R</b>estgo</a>
      </div><!-- /.login-logo -->
      <div class="login-box-body">
        <p class="login-box-msg">重置密码</p>

          <div class="form-group has-feedback">
            <input type="text" id="account" class="form-control" placeholder="请输入邮箱">
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
          </div>
		 <div class="form-group has-feedback">
            <input type="text" id="code" class="form-control" placeholder="请输入下图验证码">
            
          </div>
		
		  <div class="form-group has-feedback" >
            
			<img id="verify" src="{{apiurl "/open/verify"}}" onclick="reloadverify($(this))" />
			<a href="javascript:reloadverify($('#verify'))">点击这里刷新验证码</a>
			
          </div>
			
          <div class="form-group">

              <button type="button" onclick="login()" class="btn btn-primary btn-block btn-flat">重置密码</button>

          </div>


        <div class="social-auth-links text-center">
          <p>- OR -</p>
           <a href="{{pageurl "user/login"}}">登录</a><br>
          <a href="{{pageurl "user/register"}}" class="text-center">注册成为会员</a>
        </div><!-- /.social-auth-links -->

        

      </div><!-- /.login-box-body -->
    </div><!-- /.login-box -->

    <script>

      function reloadverify(o){
          o.attr("src",'{{apiurl "/open/verify"}}?t='+new Date().getTime())
      }
      function login(){
          var data = {};
          data.code = $("#code").val(),
          data.account = $("#account").val(),
          data.passwd = $("#passwd").val()

          xlutil.post("user/login",data).then(function(res){
                if(res.code!=200){
                    alert(res.msg)
                }else{
                    location.href = "{{pageurl "home/main"}}"
                }
          })
      }

    </script>
  </body>
</html>
{{end}}
